Crate flexiber

source ·
Expand description

flexiber

Implementation of the BER-TLV serialization format from ISO 7816-4:2005.

ITU-T X.690 (08/2015) defines the BER, CER and DER encoding rules for ASN.1

The exact same document is ISO/IET 8825-1, which is freely available, inconveniently packed as a single PDF in a ZIP file :)

Credits

This library is a remix of RustCrypto/utils/der.

The core idea taken from der is to have Encodable require an encoded_length method. By calling this recursively in a first pass, allocations required in other approaches are avoided.

Structs

  • BER-TLV decoder.
  • BER-TLV encoder.
  • Error type.
  • BER-TLV-encoded length.
  • These are tags like in SIMPLE-TLV.
  • Slice of at most Length::max() bytes.
  • The tag field consists of a single byte encoding a tag number from 1 to 254. The values ‘00’ and ‘FF’ are invalid.
  • BER-TLV data object.

Enums

Traits

  • Multiple encodables in a container.
  • Decoding trait.
  • Encoding trait.
  • This is the common trait that types to be used as tags are supposed to implement.
  • Types with an associated BER-TLV Tag.

Type Aliases